package cn.caplike.demo.repository.design.pattern.strategy;

import cn.caplike.demo.repository.design.pattern.strategy.env.Strategy;

/**
 * 上下文<br>
 * 当策略改变时, 可查看行为的变化
 *
 * @author LiKe
 * @version 1.0.0
 * @date 2020-03-14 14:25
 */
public class Context {
    private final Strategy strategy;

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    public void execute() {
        strategy.doSomething();
    }
}
